Specify -fno-strict-aliasing in root build config file.
authorKeir Fraser <keir@xensource.com>
Sat, 7 Jul 2007 09:31:15 +0000 (10:31 +0100)
committerKeir Fraser <keir@xensource.com>
Sat, 7 Jul 2007 09:31:15 +0000 (10:31 +0100)
Fixes correctness issues with xenstored and gcc-4.2.

Original patch by Charles Coffing <ccoffing@novell.com>

Signed-off-by: Keir Fraser <keir@xensource.com>
Config.mk
tools/blktap/drivers/Makefile
tools/blktap/lib/Makefile
tools/libxc/Makefile
tools/xcutils/Makefile
xen/arch/ia64/Rules.mk
xen/arch/powerpc/Rules.mk
xen/arch/x86/Rules.mk

index c77f6ae020d2045a53e3bebb3e3c393f0f1661b8..4e2977a626c37cbb793e0f528aa5ddf883449056 100644 (file)
--- a/Config.mk
+++ b/Config.mk
@@ -17,8 +17,9 @@ CONFIG_$(XEN_OS) := y
 SHELL     ?= /bin/sh
 
 # Tools to run on system hosting the build
-HOSTCC     = gcc
-HOSTCFLAGS = -Wall -Werror -Wstrict-prototypes -O2 -fomit-frame-pointer
+HOSTCC      = gcc
+HOSTCFLAGS  = -Wall -Werror -Wstrict-prototypes -O2 -fomit-frame-pointer
+HOSTCFLAGS += -fno-strict-aliasing
 
 DISTDIR     ?= $(XEN_ROOT)/dist
 DESTDIR     ?= /
@@ -58,6 +59,8 @@ else
 CFLAGS += -g
 endif
 
+CFLAGS += -fno-strict-aliasing
+
 CFLAGS += -std=gnu99
 
 CFLAGS += -Wall -Wstrict-prototypes
index c077c7221e1306fee61136006cf56a9ea1455b1d..fca48b6cedb9942f6a60317a0ead807be2894b26 100644 (file)
@@ -10,7 +10,6 @@ LIBAIO_DIR   = ../../libaio/src
 
 CFLAGS   += -Werror
 CFLAGS   += -Wno-unused
-CFLAGS   += -fno-strict-aliasing
 CFLAGS   += -I $(XEN_LIBXC) -I $(LIBAIO_DIR)
 CFLAGS   += $(INCLUDES) -I. -I../../xenstore 
 CFLAGS   += -D_GNU_SOURCE
index 833887ade04d508a455eb019e3630b21af2ac3c3..f5621e1e2391f577311120b90794b64ec7d4761c 100644 (file)
@@ -16,7 +16,7 @@ SRCS     += xenbus.c blkif.c xs_api.c
 
 CFLAGS   += -Werror
 CFLAGS   += -Wno-unused
-CFLAGS   += -fno-strict-aliasing -fPIC
+CFLAGS   += -fPIC
 # get asprintf():
 CFLAGS   += -D _GNU_SOURCE
 
index ddf99ed68444fb23b69455aefc0891e20ca9aa6d..102653ff95fc19fb28954587efb2b27289d3aa9b 100644 (file)
@@ -57,7 +57,6 @@ GUEST_SRCS-$(CONFIG_POWERPC) += xc_dom_powerpc.c
 -include $(XEN_TARGET_ARCH)/Makefile
 
 CFLAGS   += -Werror -Wmissing-prototypes
-CFLAGS   += -fno-strict-aliasing
 CFLAGS   += $(INCLUDES) -I. -I../xenstore
 
 # Needed for posix_fadvise64() in xc_linux.c
index f8ac92f7d9cb1429a750d1c7fb64364d37f91b5d..df7ee8613f200cd3a15f8d000da270fb3a8d3eaa 100644 (file)
@@ -15,7 +15,7 @@ PROGRAMS_INSTALL_DIR = /usr/$(LIBDIR)/xen/bin
 
 INCLUDES += -I $(XEN_LIBXC) -I $(XEN_XENSTORE)
 
-CFLAGS += -Werror -fno-strict-aliasing
+CFLAGS += -Werror
 CFLAGS += $(INCLUDES)
 
 # Make gcc generate dependencies.
index cfc333ee859fc9272cd53b93876063b53521eeee..389563166eb891132bf2b949077fe64fc639dcdf 100644 (file)
@@ -18,7 +18,7 @@ endif
 # Used only by linux/Makefile.
 AFLAGS_KERNEL  += -mconstant-gp -nostdinc $(CPPFLAGS)
 
-CFLAGS += -nostdinc -fno-builtin -fno-common -fno-strict-aliasing
+CFLAGS += -nostdinc -fno-builtin -fno-common
 CFLAGS += -mconstant-gp
 #CFLAGS  += -O3                # -O3 over-inlines making debugging tough!
 CFLAGS += -O2          # but no optimization causes compile errors!
index f395e88df5717cded146938bb5bbca3e3db8297b..fd26632ae6c96f9fda9e27184f42580e95a38e7a 100644 (file)
@@ -9,7 +9,7 @@ C_WARNINGS := -Wredundant-decls
 # _no_ common code can have packed data structures or we are in touble.
 C_WARNINGS += -Wpacked
 
-CFLAGS := -m64 -ffreestanding -fno-builtin -fno-common -fno-strict-aliasing
+CFLAGS := -m64 -ffreestanding -fno-builtin -fno-common
 CFLAGS += -iwithprefix include -Wall -Werror -pipe
 CFLAGS += -I$(BASEDIR)/include
 CFLAGS += -I$(BASEDIR)/include/asm-powerpc/mach-generic
index 97e376a4ab53cfb415259ad20f52e60ddbd598de..9296afd9d9292f1ab7470960cd95b23440daadf5 100644 (file)
@@ -17,7 +17,7 @@ ifneq ($(XEN_OS),SunOS)
 CFLAGS += -nostdinc
 endif
 
-CFLAGS += -fno-builtin -fno-common -fno-strict-aliasing
+CFLAGS += -fno-builtin -fno-common
 CFLAGS += -iwithprefix include -Werror -Wno-pointer-arith -pipe
 CFLAGS += -I$(BASEDIR)/include 
 CFLAGS += -I$(BASEDIR)/include/asm-x86/mach-generic